<template>
  <div>
    <el-card class="box-card">
      <div slot="header" class="clearfix">
        <span>站点监测</span>
      </div>
      <div class="body">
        <el-button type="text">操作按钮</el-button>
        <el-table :data="tableData.result" border style="width: 100%">
          <el-table-column prop="STNM" label="站点名称" width="400"></el-table-column>
          <el-table-column prop="DTYPE" label="3小时雨量" width="400"></el-table-column>
          <el-table-column prop="DTYPE" label="6小时雨量" width="400"></el-table-column>
          <el-table-column prop="DTYPE" label="12小时雨量" width="400"></el-table-column>
        </el-table>
        <div class="block">
          <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
            :page-sizes="[15, 20, 30, 50]" :page-size="15" layout="total, sizes, prev, pager, next, jumper" :total="total">
          </el-pagination>
        </div>
      </div>
    </el-card>
  </div>
</template>

<script>
export default {
  data () {
    return {
      tableData: [],
      currentPage: 1,
      total: 0
    }
  },
  created () {
    this.findData()
  },
  methods: {
    findData () {
      this.$postJSON('/ssjc/Rain/rainSectionSrByStcd').then(result => {
        this.tableData = result.data
        this.currentPage = result.data.currPage
        console.log(this.pagSize)
        this.total = result.data.total
      })
    },
    handleSizeChange (val) {
      console.log(`每页 ${val} 条`)
    },
    handleCurrentChange (val) {
      console.log(`当前页: ${val}`)
    }
  }
}
</script>

<style scoped>
.text {
  font-size: 14px;
}

.item {
  margin-bottom: 18px;
}

.box-card {
  margin: 10px;
  width: 98%;
}

.block {
  margin-top: 8px;
  margin-left: 50px;
}
</style>
